External metadata for streaming runner v1 changes - #36373
Conversation
Summary of ChangesHello @stankiewicz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request lays the groundwork for integrating external metadata support within the Apache Beam Dataflow streaming runner. The changes introduce an experiment flag to control the activation of this feature, establish the initial serialization and deserialization mechanisms for metadata protos in the Windmill backend, and strategically place placeholders for the subsequent full implementation of metadata propagation throughout the WindowedValue lifecycle. This foundational work is crucial for enabling more sophisticated data processing and observability features in streaming pipelines by allowing additional, user-defined metadata to be carried alongside data elements. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Assigning reviewers: R: @m-trieu for label java. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
kennknowles
left a comment
There was a problem hiding this comment.
If I understand correctly this is a noop but it adds the ability for the Windmill shuffle to read/write extended metadata, preparing for adding it end-to-end. Yes?
| public void processElement( | ||
| @Element KV<K, ValueInSingleWindow<V>> kv, | ||
| OutputReceiver<KV<K, V>> outputReceiver) { | ||
| // todo #33176 specify additional metadata in the future |
There was a problem hiding this comment.
Yea I think we'll want to find a way to update Redistribute to automatically carry along "all" metadata. We built a separate data type for Redistribute to avoid making WindowedValue public. But now that it is public and everything around it is public (or public enough) we should make it possible to be resilient to new metadata being added without having to edit Redistribute or the overrides.
| // element metadata is behind the experiment | ||
| boolean elementMetadata = WindowedValues.WindowedValueCoder.isMetadataSupported(); | ||
| if (elementMetadata) { | ||
| PaneInfoCoder.INSTANCE.encode(paneInfo, stream); |
There was a problem hiding this comment.
IIRC in the design there would be a bit in the PaneInfo that indicates if there is any metadata in the stream, right? Or I guess that is only for the coder and we always put it in the WindmillSink/WindmillSource exchange?
There was a problem hiding this comment.
ah, missed that , it should be:
PaneInfoCoder.INSTANCE.encode(paneInfo.withElementMetadata(elementMetadata), stream);
|
|
||
| Assert.assertEquals(value.getValue(), decodedValue.getValue()); | ||
| Assert.assertEquals(value.getTimestamp(), decodedValue.getTimestamp()); | ||
| Assert.assertArrayEquals(value.getWindows().toArray(), decodedValue.getWindows().toArray()); |
There was a problem hiding this comment.
This doesn't actually have any extended metadata, right?
There was a problem hiding this comment.
correct, asserts will have to be added once we have any kind of metadata added, currently this is noop.
There was a problem hiding this comment.
but it tests actual serde with metadata (even empty)
kennknowles
left a comment
There was a problem hiding this comment.
Since this is mostly a preparatory noop, fine with me.
|
Kicked the tests. I think the particular windmill test that failed may be a known flake - potentially worth deflaking if it hits another time. |
|
Run Java PreCommit |
|
xlang issue is unrelated. |
|
Run Java_IOs_Direct PreCommit |
|
Run Java PreCommit |
|
Run Xlang_Generated_Transforms PreCommit 3.9 |
|
Run Xlang_Generated_Transforms PreCommit |
This change adds:
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.